﻿using BoriPetr.OAuth;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BoriPeter.FatSecret.Messages
{
    public class FatSecretMessageBase<T> : OAuthMessageBase<T>
    {
        protected const string METHOD = "method";
        protected const string OAUTH_TOKEN = "oauth_token";

        protected override T ProcessResponse(string response)
        {
            return Deserializer.XmlFromString<T>(response);
        }

        public FatSecretMessageBase() : base(FatSecretCommon.Settings, FatSecretCommon.AccessToken)
        {
            AddRequestParameter(OAUTH_TOKEN, FatSecretCommon.AccessToken.Token);
        }
    }
}
